package com.steamedfish.auctioncloudprocess.feign.client;

import com.steamedfish.auctioncloudprocess.entiry.UserEntiry;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Service
@FeignClient(value = "auction-security-server-oauth")
public interface SecurityOAuth2Client {

    @RequestMapping(value = "/oauth/token", method = RequestMethod.GET)
    public String token(@RequestParam(value = "client_id") String client_id,
                        @RequestParam(value = "client_secret")String client_secret,
                        @RequestParam(value = "grant_type")String grant_type,
                        @RequestParam(value = "redirect_uri")String redirect_uri);

    @RequestMapping(value = "/auctionsecurityserveroauth2/service/userEntiry/userinfo", method = RequestMethod.GET)
    public UserEntiry getUserInfo(@RequestParam(value = "id") String id);
}